<template>
  <el-menu
      router
      default-active="this.$router.path"
      class="el-menu-demo"
      mode="horizontal"
      background-color="rgba(255, 129, 108, 0.9)"
      text-color="#fff"
      active-text-color="#fbfafa">

    <el-menu-item index="/Custom/custom_index">首页</el-menu-item>
    <el-menu-item index="/Custom/custom_login">在线咨询</el-menu-item>
    <el-menu-item index="/Custom/custom_assess">心理测评</el-menu-item>
    <el-menu-item index="" @click="home()">个人中心</el-menu-item>

  </el-menu>
</template>

<script>
export default {
  name: "menu",
  methods:{
    home(){
      if (!window.sessionStorage.getItem("token")){
        this.$message.warning("请先登录哦~");
        return false;
      }else {
        this.$router.push({ path: "/Custom/custom_home" });
      }
    }
  }
}
</script>

<style scoped>

</style>